<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Roles</title>
<script type="text/javascript">
validarCamposRolEditar = function(){
	try{
		var frmNuevoRol = document.getElementById("frmEditarRol");
		var descRol = frmNuevoRol.elements['descRol'].value;
		var errorDiv = document.getElementById("errorDiv");
		if(descRol == ""){
			document.getElementById("errorDiv").innerHTML = "El campo esta vacio";
		} else {
			document.getElementById("errorDiv").innerHTML = "";
			frmNuevoRol.submit();
		}
	}catch(e){
		alert("validarCamposRolEditar  [  " + e);
	}
};
</script>
</head>
<body>
<div id="global">
<div id="header">
<jsp:include page="/header.jsp"></jsp:include>
</div>
<div id="body">
<h3 class="ui-widget-header">MODIFICAR ROL</h3>
<div id="form-roles">
<form action="${pageContext.request.contextPath}/roles/rolesController?method=3" id="frmEditarRol" name="frmEditarRol" method="post">
    <table id="table-form-roles">
        <tr>
           <td class="label">
               <label for="">ID ROL:</label>
           </td>
           <td class="control">
               <input type="text" name="idRol" id="idRol"  value="${requestScope.rolVo.idRol}" class="required" readonly="readonly"/>
           </td>
       </tr>
       <tr>
           <td class="label">
               <label for="">DESCRIPCION ROL:</label>
           </td>
           <td class="control">
               <input type="text" name="descRol" id="descRol"  value="${requestScope.rolVo.descRol}" class="required" />
               <div id="errorDiv" style="color:red;"></div>
           </td>
       </tr>
       <tr>
           <td class="label">
               <label for="">VIGENCIA:</label>
           </td>
           <td class="control">
                <select id="idVigencia" name="idVigencia" class="drop-down" > 
                <option value="${requestScope.rolVo.idVigencia}" selected>${requestScope.rolVo.descVigencia}</option>
				<c:forEach items="${listVigencia}" var="order" varStatus="orderStatus">
					<c:if test="${order.idValorCad != requestScope.rolVo.idVigencia}">
				  		<option value="${order.idValorCad}"> ${order.descValor} </option>
				  	</c:if>
				</c:forEach>
				</select>
           </td>
       </tr>
       <tr>
               <td colspan="2" align="center"><input type="button" value="Guardar" class="buttonGreen" onclick="validarCamposRolEditar();"/></td>
       </tr>
    </table>
</form>
</div>
</div>
</div>
</body>
</html>
